using System;
using System.Collections;
using System.Collections.Generic;


namespace NanoERP.Model
{
	/// <summary>
    /// 部门信息
	/// </summary>
	[Serializable]
	public sealed class Deptinfo 
	{
		#region Private Members
		
		// Variabili di stato
		private bool _isChanged;

		// Primary Key(s) 
		private int _id; 
		
		// Properties 
		private string _deptname; 
		private string _deptpym; 
		private string _depttype; 
		private int? _parentdeptid; 
		private string _manager; 
		private int? _tag; 
		private string _note; 
		private string _exfield1; 
		private string _exfield2; 
		private string _exfield3; 
		private string _exfield4; 
		private int? _createmanid; 
		private DateTime? _createdate; 		

		#endregion
		
		#region Default ( Empty ) Class Constructor
		
		/// <summary>
		/// default constructor
		/// </summary>
		public Deptinfo()
		{
			_id = 0; 
			_deptname = null; 
			_deptpym = null; 
			_depttype = null;  
			_parentdeptid = null;
			_manager = null;  
			_tag = 0;
			_note = null; 
			_exfield1 = null; 
			_exfield2 = null; 
			_exfield3 = null; 
			_exfield4 = null;  
			_createmanid = null; 
			_createdate = DateTime.Now;
		}
		
		#endregion // End of Default ( Empty ) Class Constructor
		
		#region Full Constructor
		
		/// <summary>
		/// full constructor
		/// </summary>
		public Deptinfo(int id, string deptname, string deptpym, string depttype, int? parentdeptid, string manager, int? tag, string note, string exfield1, string exfield2, string exfield3, string exfield4, int? createmanid, DateTime? createdate)
		{
			_id = id; 
			_deptname = deptname; 
			_deptpym = deptpym; 
			_depttype = depttype; 
			_parentdeptid = parentdeptid; 
			_manager = manager; 
			_tag = tag; 
			_note = note; 
			_exfield1 = exfield1; 
			_exfield2 = exfield2; 
			_exfield3 = exfield3; 
			_exfield4 = exfield4; 
			_createmanid = createmanid; 
			_createdate = createdate; 
		}
		
		#endregion // End Full Constructor
		
		#region Required Fields Only Constructor
		
		/// <summary>
		/// required (not null) fields only constructor
		/// </summary>
		public Deptinfo(int id)
		{
			_id = id; 
			_deptname = null; 
			_deptpym = null; 
			_depttype = null;  
			_parentdeptid = null;
			_manager = null;  
			_tag = null;
			_note = null; 
			_exfield1 = null; 
			_exfield2 = null; 
			_exfield3 = null; 
			_exfield4 = null;  
			_createmanid = null; 
			_createdate = null;
		}
		
		#endregion // End Required Fields Only Constructor

		#region Public Properties
			
		/// <summary>
		/// 主键
		/// </summary>		
		public int Id
		{
			get { return _id; }
			set { _isChanged |= (_id != value); _id = value; }
		} 
	  
		/// <summary>
		/// 部门表
		/// </summary>		
		public string Deptname
		{
			get { return _deptname; }
			set	
			{
				if ( value != null )
					if( value.Length > 100)
						throw new ArgumentOutOfRangeException("Invalid value for Deptname", value, value.ToString());
				
				_isChanged |= (_deptname != value); _deptname = value;
			}
		} 
	  
		/// <summary>
		/// 拼音码
		/// </summary>		
		public string Deptpym
		{
			get { return _deptpym; }
			set	
			{
				if ( value != null )
					if( value.Length > 100)
						throw new ArgumentOutOfRangeException("Invalid value for Deptpym", value, value.ToString());
				
				_isChanged |= (_deptpym != value); _deptpym = value;
			}
		} 
	  
		/// <summary>
		/// 部门类型
		/// </summary>		
		public string Depttype
		{
			get { return _depttype; }
			set	
			{
				if ( value != null )
					if( value.Length > 100)
						throw new ArgumentOutOfRangeException("Invalid value for Depttype", value, value.ToString());
				
				_isChanged |= (_depttype != value); _depttype = value;
			}
		} 
	  
		/// <summary>
		/// 上级部门编号
		/// </summary>		
		public int? Parentdeptid
		{
			get { return _parentdeptid; }
			set { _isChanged |= (_parentdeptid != value); _parentdeptid = value; }
		} 
	  
		/// <summary>
		/// 部门经理
		/// </summary>		
		public string Manager
		{
			get { return _manager; }
			set	
			{
				if ( value != null )
					if( value.Length > 50)
						throw new ArgumentOutOfRangeException("Invalid value for Manager", value, value.ToString());
				
				_isChanged |= (_manager != value); _manager = value;
			}
		} 
	  
		/// <summary>
		/// 标记（显示顺序）
		/// </summary>		
		public int? Tag
		{
			get { return _tag; }
			set { _isChanged |= (_tag != value); _tag = value; }
		} 
	  
		/// <summary>
		/// 备注
		/// </summary>		
		public string Note
		{
			get { return _note; }
			set	
			{
				if ( value != null )
					if( value.Length > 600)
						throw new ArgumentOutOfRangeException("Invalid value for Note", value, value.ToString());
				
				_isChanged |= (_note != value); _note = value;
			}
		} 
	  
		/// <summary>
		/// 
		/// </summary>		
		public string Exfield1
		{
			get { return _exfield1; }
			set	
			{
				if ( value != null )
					if( value.Length > 100)
						throw new ArgumentOutOfRangeException("Invalid value for Exfield1", value, value.ToString());
				
				_isChanged |= (_exfield1 != value); _exfield1 = value;
			}
		} 
	  
		/// <summary>
		/// 
		/// </summary>		
		public string Exfield2
		{
			get { return _exfield2; }
			set	
			{
				if ( value != null )
					if( value.Length > 100)
						throw new ArgumentOutOfRangeException("Invalid value for Exfield2", value, value.ToString());
				
				_isChanged |= (_exfield2 != value); _exfield2 = value;
			}
		} 
	  
		/// <summary>
		/// 
		/// </summary>		
		public string Exfield3
		{
			get { return _exfield3; }
			set	
			{
				if ( value != null )
					if( value.Length > 100)
						throw new ArgumentOutOfRangeException("Invalid value for Exfield3", value, value.ToString());
				
				_isChanged |= (_exfield3 != value); _exfield3 = value;
			}
		} 
	  
		/// <summary>
		/// 
		/// </summary>		
		public string Exfield4
		{
			get { return _exfield4; }
			set	
			{
				if ( value != null )
					if( value.Length > 100)
						throw new ArgumentOutOfRangeException("Invalid value for Exfield4", value, value.ToString());
				
				_isChanged |= (_exfield4 != value); _exfield4 = value;
			}
		} 
	  
		/// <summary>
		/// 创建人编号 表：USERINFO
		/// </summary>		
		public int? Createmanid
		{
			get { return _createmanid; }
			set { _isChanged |= (_createmanid != value); _createmanid = value; }
		} 
	  
		/// <summary>
		/// 创建日期
		/// </summary>		
		public DateTime? Createdate
		{
			get { return _createdate; }
			set { _isChanged |= (_createdate != value); _createdate = value; }
		} 
		
		#endregion 
		
		
	}
}